﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebApp.secure_pages
{
    public partial class citizens : System.Web.UI.Page
    {

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Request.IsAuthenticated)
            {
                Response.Redirect("~/Account/Login.aspx");
            }

            String name = HttpContext.Current.User.Identity.Name;

            var db = new F11ITNET2Gr7Entities();
            var user = db.GPSysUser.Single(u => u.UserName == name);
            EntityDataSource1.Where = "it.DocId =" + user.DocId;
            

        }

        protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
        {
            
            var citizenid = GridView1.SelectedValue;
            Session["citizenid"] = citizenid;
            Response.Redirect("citizen.aspx");
            

        }
       
    }
}